*******************************
* IRCA and Redistricting
* Navid Sabet and Noam Yuchtman
* Table B1: Hispanic ardent supporters using ANES
*******************************

// 	Setup
	do "$dofiles/00_setup.do"

//	Load
	use "$dta/anes.dta", clear
	
	
***********************
*	Report Results: Ardent Support
**********************		
eststo clear			
reghdfe vote_dem_gov hispanic c.age##c.age i.VCF0114 i.educ married employed male foreign_born, a(id year) cluster(id)
	estadd scalar clusters = e(N_clust)
	sum vote_dem_gov if e(sample) 
	estadd scalar mean_y = r(mean)
	estadd scalar sd_y = r(sd)
	tab year if e(sample)
	eststo
	
reghdfe vote_dem_pres hispanic  c.age##c.age i.VCF0114 i.educ married employed male foreign_born, a(id year) cluster(id)
	estadd scalar clusters = e(N_clust)
	sum vote_dem_pres if e(sample)
	estadd scalar mean_y = r(mean)
	estadd scalar sd_y = r(sd)
	tab year if e(sample)
	eststo

	tab VCF0218
reghdfe VCF0218 hispanic c.age##c.age i.VCF0114 i.educ married employed male foreign_born if VCF0218<98, a(id year) cluster(id)
	estadd scalar clusters = e(N_clust)
	sum VCF0218 if e(sample) 
	estadd scalar mean_y = r(mean)
	estadd scalar sd_y = r(sd)
	tab year if e(sample)
	eststo
	
	
reghdfe VCF0839 hispanic  c.age##c.age i.VCF0114 i.educ married employed male foreign_born if VCF0839<9 & VCF0839>0, a(id year) cluster(id)
	estadd scalar clusters = e(N_clust)
	sum VCF0839 if e(sample) 
	estadd scalar mean_y = r(mean)
	estadd scalar sd_y = r(sd)
	tab year if e(sample)
	eststo
	
***********************
*	Generate Table
**********************		

estfe 	est*
esttab  est*	using "${output}/tabB1.tex", replace booktabs ///
				nonote noobs nogaps compress noeqlines se substitute(_ _) label interaction(" $\times$ ") ///
				mgroups("Voted Democrat" "Democratic Values", pattern(1 0 1 0) ///
				prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
				mtitles("\makecell{Governor \\ Election}" "\makecell{Presidential \\ Election}" "\makecell{Democrat \\ Thermometer}" "\makecell{Gov't Provide \\ More Services }") ///
				scalars("N $N$" "clusters Clusters" "mean_y $\bar{Y}_{102}$" "sd_y [S.D]") sfmt(%9.3gc) ///
				star(* 0.1 ** 0.05 *** 0.01) ///
				keep(hispanic)
				
				
				//Years in Sample        &  \makecell{80, 82, 86, \\ 90, 94}            &   \makecell{80, 84, \\ 88, 92}           &  \makecell{80,82,84,86, \\ 88,90,92,94}      &    \makecell{82,84,86, \\ 88,90,92,94}           \\ \cmidrule{2-5}
